UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PT4KUTbXUeD5eRQPHg56wcrhP1BvBbnmxutzS5Ff22Y='
WHERE
key_id = '0d5cca9d206c4a19e55a1c87f2fa1a30f449ac18729dfb45fdda56e500e664d6'
AND (
token = 'PT4KUTbXUeD5eRQPHg56wcrhP1BvBbnmxutzS5Ff22Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)