As I wrote somewhere in a thread linked above, the conditional clause is one of the hardest grammatical issues to grasp for non-native learners. Most textbooks use many pages for these structures. It's almost impossible to explain it in a simple way.
As for your example, たら is used there since it's "one-off situation", and とき is wrong since it means "before I go to Japan". See the following post. 時 in the following sentence | Japan Forum
It's been described to me as the various forms of "if" living on a spectrum of certainty, with ~ば at the less certain end, and ~たら at the other end, so much so that it's less "if" but more "when/once" the conditional event happens.