UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8q9mko/72tLGymFfKqT8q4x0IoXVZlQ0oy8HrC7aQmQ='
WHERE
key_id = '0b9e1e1064635a99659c57de55081310779d88190280758e40c9b130c4301b79'
AND (
token = '8q9mko/72tLGymFfKqT8q4x0IoXVZlQ0oy8HrC7aQmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)