UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9EWMMW06nv1sAIGpYhV/RP1b/EhBtyFLmF58oMbnQ7Y='
WHERE
key_id = '9e4fad6d14965e4cbb7a7613cdcb958a7417801602bb5a785c77d83aec3be458'
AND (
token = '9EWMMW06nv1sAIGpYhV/RP1b/EhBtyFLmF58oMbnQ7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)