The Time Lock wasn't undone; The Moment was powerful enough to get around it (as Matt Smith noted explicitly). Also, the event happened on the last day of the Time War, but the events in "The End of Time" were midway through the war (months or even years before). Presumably, the people the Doctor kicked back into the time lock had time to humbly reassess their selfish and destructive plans. Hell, the Doctor's mother might have helped engineer an overthrow of the Council in the interim, or the generals might have just declared martial law à la Egypt.
The Valeyard concept really needs to be addressed somehow, though.
... in the second part of The End of Time, when the Time Lord leaders have their conference, it's stated that the Visionary's prophecies all confirm that "this is the last day of the Time War." It's acknowledged that the Doctor already has the Moment. Later on, Tennant reconfirms that it was the last days of the war that were coming through the link.
But I suppose it's possible that Gallifrey was saved on that same last day, after Rassilon's failed attempt to escape and before the establishment of the Time Lock. And if Gallifrey was planning to end creation in the last days (as stated by Rassilon), they'd have to have had a quick change of heart for the Gallifrey that was saved to be a shiny happy place that the Doctor will want to recover. It just seems like a pretty cluttered timeline. I'm okay with that. It's really hard to do a perfectly clean reinterpretation of previous events that were made without consideration of what would eventually be done.
Chapterfish — Nate's Writing Blog
http://chapterfish.wordpress.com