UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gAiEuRtHTkzAA7YA2gQDl5jlRYLWPeezdjsYpaaUH4A='
WHERE
key_id = '93c0a6ba7679ad181d188348fcdf40898c1c15f1027750c0a16120a1bd64445b'
AND (
token = 'gAiEuRtHTkzAA7YA2gQDl5jlRYLWPeezdjsYpaaUH4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)