UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't9WUSc+f38oeHRrlHb7rjAosQaHHTX7zJ48kKfYKlVI='
WHERE
key_id = '326c53a35bda4440292c8438e46e25061021a6589732cbebdd3b182f90655d20'
AND (
token = 't9WUSc+f38oeHRrlHb7rjAosQaHHTX7zJ48kKfYKlVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)