UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JByYZXtdoZvvodk9+zZ4QFlXPTIjHuWg7B9jZK0Ugiw='
WHERE
key_id = '53494d1f9b3dc1e8a36d57ade011ab4e1c3ee914c57e02406ab5c4503afb01f7'
AND (
token = 'JByYZXtdoZvvodk9+zZ4QFlXPTIjHuWg7B9jZK0Ugiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)