UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q0GHxPO/eEj3S7ZSm2Lr4kREjTPLuyxAWg3KnlvR5vs='
WHERE
key_id = '0841f150b7e130a111b95a4c74aeb93a230986491696c5283b96a1a949b5ea4b'
AND (
token = 'q0GHxPO/eEj3S7ZSm2Lr4kREjTPLuyxAWg3KnlvR5vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)