UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SMuC+/nA1xg1yAHigz/MYyyHBjsyPeMCqoMxZvPOcrs='
WHERE
key_id = '014d0003e5f8e89b7462120a2d006c5199acb594e386e7f0f134f6d8490cbd92'
AND (
token = 'SMuC+/nA1xg1yAHigz/MYyyHBjsyPeMCqoMxZvPOcrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)