UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B/AkkDN4vqFKPwga8VwxBvnI2OE5LMSAZONPmWfGocQ='
WHERE
key_id = '23c9bdda2a499d99b7d5bcfbe11cfbcb31246f5acb39cc8ce2de80da0b3799fe'
AND (
token = 'B/AkkDN4vqFKPwga8VwxBvnI2OE5LMSAZONPmWfGocQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)