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