UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6FxUFU1VVQVQWmLFkS5cpmEG5q5m7YvVbpk19oWECc='
WHERE
key_id = 'aeb751f6dcff1fe0f60b97291a2f1a4f69a4c7c91e33352bc953c4d5c8ac02ca'
AND (
token = 'Z6FxUFU1VVQVQWmLFkS5cpmEG5q5m7YvVbpk19oWECc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)