〜とき + particle

MNN28-5

とき is a noun therefore it can take particles.