UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QPSiQWCi1iTMm9pmCZhJuTkr7uoSxg8KD+9lv0gImZw='
WHERE
key_id = '69755ff47895d1464fb5ffa6b25fd7c615701a9204297db082c4fb5ac1bfaf7e'
AND (
token = 'QPSiQWCi1iTMm9pmCZhJuTkr7uoSxg8KD+9lv0gImZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)