In a large bowl, combine soy sauce, brown sugar, water, rice vinegar, minced garlic, grated ginger, black pepper, and red pepper flakes (if using). Whisk until the sugar is dissolved.
Place the chicken thighs in a large resealable plastic bag or a shallow dish. Pour the marinade over the chicken, ensuring all pieces are well coated. Seal the bag or cover the dish and refrigerate for at least 1 hour, preferably overnight for maximum flavor.
Preheat your oven to 375°F (190°C).
Remove the chicken from the marinade and place it in a baking dish. Reserve the marinade for later use.
Bake the chicken in the preheated oven for 30 minutes.
While the chicken is baking, pour the reserved marinade into a saucepan and bring it to a boil over medium heat. Reduce the heat and let it simmer for about 10 minutes until slightly thickened.
After 30 minutes, baste the chicken with the thickened marinade and bake for an additional 15-20 minutes, or until the chicken reaches an internal temperature of 165°F (74°C) and is golden brown.
Remove the chicken from the oven and let it rest for 5 minutes before serving. Garnish with chopped green onions and sesame seeds.