UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOJJbmX0wLT5bVwA3P9IffvpmFs7aGoM5etAmt3fJD4='
WHERE
key_id = '5f78b39b7c266f2d3ee78564ff9cdc60a9cec344ec3b19c5f006f07480e8e53f'
AND (
token = 'KOJJbmX0wLT5bVwA3P9IffvpmFs7aGoM5etAmt3fJD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)