English "when" clause can be expressed by "toki" in Japanese.
Like English "when" clause (when S+V, another S+V || another S+V when S+V), you can use "toki"
like S+V toki, S+V. For example,
When I'm going to Japan, ... = Watashi ga Nippon ni iku toki, .....
I will eat when I am there. = Soko ni iru toki, Watashi wa nanika taberu tsumori desu.