UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVfsFr8eUtVkjZiNqvS9IIwNFRxnZQvCp8R9hWuZa+M='
WHERE
key_id = '3d0f90fda990db5c5862f7e881ba19ef87d7823575f661e4cbd303e53fa4ec2e'
AND (
token = 'aVfsFr8eUtVkjZiNqvS9IIwNFRxnZQvCp8R9hWuZa+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)