UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xTuFpkjG/4PDA4n0IqZO+ieCIJf7GRrfWE4SIK8taP8='
WHERE
key_id = '28d5ffdba8d9f299176d4532857aeb6ffe73c7640a4550f0d7172700b9dfe047'
AND (
token = 'xTuFpkjG/4PDA4n0IqZO+ieCIJf7GRrfWE4SIK8taP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)