UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UUrEzpM8Iq7oTyxY3J2NWzHNUfdZdVEyrAStP3LfOp0='
WHERE
key_id = '9ab8f45929cfe5b7e6c401fa13723704456f10dc4f08ea6ed2ade731c96ea7bc'
AND (
token = 'UUrEzpM8Iq7oTyxY3J2NWzHNUfdZdVEyrAStP3LfOp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)