UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NTCBOuv72jQ1x6GS92KzbYPUqzbuwXY7cMcmJklbIK4='
WHERE
key_id = '88b73c3d5c0634b8e569afcd69d12e5595dffc2d1b046bd0d6f48090de612b0d'
AND (
token = 'NTCBOuv72jQ1x6GS92KzbYPUqzbuwXY7cMcmJklbIK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)