Either can be used, and no one will question either. "When" offers a more logical correctness, yes, but sadly "where" is probably what a native speaker would use, since "where" is much more commonly used to relate situations, like that. When in use like that, "Where" loses most of its locational meaning in our minds and just takes on a relating role.