UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EghnhnVB7LdSVub67XAno+ihoOT9cpzpYR4F5TQit+Y='
WHERE
key_id = 'e5c772ceca465c176fdaa1ea34a62b7b60aca0498bd51b1dd649533957efdcdd'
AND (
token = 'EghnhnVB7LdSVub67XAno+ihoOT9cpzpYR4F5TQit+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)