When とき comes before a past-tense sentence. It describes when that event happened.
When I was a child, I used to love baseball.
This also works with adjectives.
When I was young, I used to like manga.
Note that unlike English, the adjective doesn’t go to the past tense. とき describes a time when the speaker was still young – they hadn’t stopped being young so the adjective doesn’t take the past tense. The tense of the whole sentence is determined by the main ending でした。
This can of course work with verbs too:
When I went to Tokyo, I went by plane.
Again, the fact that the journey happened in the past is shown by the final verb ending. とき describes a time when the speaker was still on their way, they hadn’t arrived, the action wasn’t completed, so the first verb doesn’t take a -た ending.
Now look at this:
When I went to Tokyo, I studied Aikido.
Now とき describes a time when the speaker had arrived in Tokyo, the action was completed, so the first verb takes a -た ending.