UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wcl+rcFois4kPZP6zV3SI4IbJFrPNAM/sHoVG6RYy4Y=' 
WHERE 
  key_id = '395c3bb844253149ba1602957cdbc6afe38f4ff575ca0f8ffc2d157434f215a0' 
  AND (
    token = 'wcl+rcFois4kPZP6zV3SI4IbJFrPNAM/sHoVG6RYy4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035