UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ILglogcEmMTX0ub6YxBMzw4jXQPiQrPCGYbLjUB7EYc='
WHERE
key_id = '54f5a56e0008cc6667b8df8613a5713fcad3deffee148d226bd0bcd7e2d768c0'
AND (
token = 'ILglogcEmMTX0ub6YxBMzw4jXQPiQrPCGYbLjUB7EYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)