UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F76TxSawfJfn9UIXlm0Vh+ne8eoaUQ3XHEtaR2omSw8='
WHERE
key_id = '1b67b64e675e9dd646ec9eb2c12ba6a26d67d07fb8fa45d56e45089896b3e08c'
AND (
token = 'F76TxSawfJfn9UIXlm0Vh+ne8eoaUQ3XHEtaR2omSw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)