UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bOaQzEFZ5zk5KjJH9lKrkyhnCiai6f1s9uWNSujQPoE='
WHERE
key_id = '9368d027ccde81bb094a925c46553a395182c6b2c5028eb1a272a4d43f33b012'
AND (
token = 'bOaQzEFZ5zk5KjJH9lKrkyhnCiai6f1s9uWNSujQPoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)