UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mw0KP7z31O6rvFM8dGSMAxLmxHIBXdyorQIBdVUxJCc='
WHERE
key_id = 'b901d5b220a03114a1f601179fe9aa06c5eabe2cf9cde6b6c8e38f7b76c3a705'
AND (
token = 'mw0KP7z31O6rvFM8dGSMAxLmxHIBXdyorQIBdVUxJCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)