UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ts9hqxw9Ctjvo1EcEv8LLMOQvEBFLjEcLJu21uZrD8E='
WHERE
key_id = '5caece4bfe204f9853f9f8fa9c0dfb028cc22fbff9d549d96cec05334cff6d88'
AND (
token = 'ts9hqxw9Ctjvo1EcEv8LLMOQvEBFLjEcLJu21uZrD8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)