UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7SjG8ZnlwUNmw1ViQS332OolJd0aJsnqEDjoS2oR1Y='
WHERE
key_id = '51100f71cabe9a8dccdac41b87d1eaed5d1ed0ed238613664f9393fc6d0fb5fd'
AND (
token = 'n7SjG8ZnlwUNmw1ViQS332OolJd0aJsnqEDjoS2oR1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)