UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7Ymu3N0WSXwvSk7V+nfYsMJchBW3LeaA/Mwl0EZslY='
WHERE
key_id = 'cf6a26cdfe3af14347a7678cc259af0a71f439e097b993f8b7a4d25f5782c9eb'
AND (
token = 'A7Ymu3N0WSXwvSk7V+nfYsMJchBW3LeaA/Mwl0EZslY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)