UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ev31rtRdYKjtd6gKTE8sBjZJ9QDbks/ZoGayPW5GWVc='
WHERE
key_id = '1e7f4f260996670aaabd5916bf881a4b69119a41248b050be307b13333ef79ea'
AND (
token = 'ev31rtRdYKjtd6gKTE8sBjZJ9QDbks/ZoGayPW5GWVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)