UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60afojxUxc+wNRKFTtNqgWBatVXHTZuWCpQYXxwLFQk='
WHERE
key_id = 'aa99c0ec96f51251b1c7e78bc4a12236b83cf225f4f33c15bb9c5ee9a66f4ccb'
AND (
token = '60afojxUxc+wNRKFTtNqgWBatVXHTZuWCpQYXxwLFQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)