I can see why you find it a bit confusing, but Pieanne is right when she says
"Where" can be justified by implying "in the case where".
In Swan's Practical English Usage, he discusses this in Section 525, subsection 5, on relative pronouns. His opinion is 'After nouns referring to times . . . where can