UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QK8cBqyl++iXASVAqwLn3UWgg8VqLKGccMQVf8JN15Y='
WHERE
key_id = 'a3b9c3c2d8cd8f25c17ef35c00abb7831347efaf895ce71589572340d98c926d'
AND (
token = 'QK8cBqyl++iXASVAqwLn3UWgg8VqLKGccMQVf8JN15Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)