pH does tend to rise through the course of the mash. I find that its best to collect a sample as early as possible after the dough in and mixing or recirculation so that you have an opportunity to adjust pH in a timely manner. Certainly within the first 15 minutes, if not earlier.
Do remember that ATC is NOT useful in brewing since there are 2 factors that alter the pH reading of the mash. ATC only corrects one of them. Therefore, it is better for the reading accuracy and for the protection of the pH probe to cool the sample to room temperature before checking pH.