The earlier you arrive the better, since there are a limited number of lockers, and demand often outstrips supply. That said, there must be at least some turnover during the day. I would guess that the lockers are most available early mornings, and later afternoons, while mid-day they are probably more scarce (just guessing based on how I would expect people to need them).
I don't recall what time we arrived, but knowing myself and my travel partner, it probably was not first thing in the morning (remember, the lockers are in the bus station, not the train station -- very likely most users are bus passengers and there are probably more bus arrivals/departures than trains).
I've done the jump-off-the-train-and-race-for-a-locker game in Cordoba twice. Both times we got a locker or two as we needed (because we won the race). Both times we saw the remaining lockers fill up as we were leaving, both times we observed what appeared to be train passengers still making their way slowly towards the bus station, possibly in search of a locker.
You don't have to be able to run faster than the bear...you just need to be able to run faster than the other people looking for the last available locker. 🏃🏻♂️💨