UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZIT/NlQAmcoXmprZjKOTRMVSkpxklUKAzX57XywhRmU='
WHERE
key_id = 'e9904fdb6cd7cb57919a51f4d94b82f600563b9fc72ad543af56b7f93ed40e08'
AND (
token = 'ZIT/NlQAmcoXmprZjKOTRMVSkpxklUKAzX57XywhRmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)