UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MtgG/tz62aFSCuxV4AKnV9Q6qTXPICxdUIr7UoE7Cmw='
WHERE
key_id = 'e78fd7456aef67ac67f100568418fa0743f0a87a7eb41a81bfdbaad484e9b0a9'
AND (
token = 'MtgG/tz62aFSCuxV4AKnV9Q6qTXPICxdUIr7UoE7Cmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)