UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fw8K1eIoIxvkwKNmiRQ1igpJ5T/7jYHRAk6X9HLT4VA='
WHERE
key_id = 'f27870bbd224ecc1d9bb996f30451aa9a4e8f069f55274f58a07ce4fedf8601a'
AND (
token = 'fw8K1eIoIxvkwKNmiRQ1igpJ5T/7jYHRAk6X9HLT4VA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)