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