普通に if (targetData.ifPresent()) { update(targetData.get()); return ok; } else return ng; でいいでしょ
副作用を生じる部分はなるべく明確に分離した方がいい