The time lock, as it pertains to the mechanism that prevents the Doctor from re-entering the Time War, does not encompass the whole of Gallifrey's past. It only serves to keep time-travelers from coming into the War, and to keep what's in the War from getting out:
DOCTOR: Inside the Time War. And the whole War was time-locked. Like, sealed inside a bubble. It's not a bubble, but just think of a bubble. Nothing can get in or get out of the time lock.
Gallifrey's past from before the War was never said to be time-locked; however, there seems to be some kind of implied mechanism, that is comparable to a time lock but isn't exactly the same thing, that prevents Time Lords from traveling to any point in Gallifrey's timeline other than its relative present, and keeps their visits to the planet in sync with one another, which explains why Time Lords have to use scrolls and seers all the time (as they cannot go into Gallifrey's past or future for themselves), and why the Time Lords always appear to meet in the right order on Gallifrey. But, as even the existence of this mechanism has never been clearly established, let alone explained in any detail, we cannot say for certain how the events of "Listen" correlate to it. (Although, it would be logical to assume that such a thing exists anyway, as any time-traveling civilization worth their salt would naturally want to keep their past from being interfered with.)
Nevertheless, it is clear from the presentation in "Listen" that the TARDIS' trip into Gallifrey's past is not normally supposed to be happen, hence the red warning lights and the alarms that flood the console room when it happens. And that is because these were not normal circumstances. For one thing, it was noted at least twice that the Doctor had taken down the ship's safety functions, which is how he first got to the end of the universe (saying, "the TARDIS isn't supposed to come this far, but some idiot turned the safeguards off"). Furthermore, Clara was piloting the TARDIS in a way that we have never seen before (via the telepathic interface), and the Doctor said that he had slaved the ship to her timeline (and the last time that we saw somebody traveling along a raw timeline was in "The Name of the Doctor", when Clara stepped into the Doctor's postmortem timestream and was spliced throughout his past, including his early days on Gallifrey).
So, ultimately, the answer is that she managed it by piloting the ship in a very unconventional way while the safeguards were off, which allowed her to bypass the very vaguely-defined temporal barrier that would normally keep Time Lords in sync with Gallifrey.