The weather may determine how long to stay. The other consideration is there are numerous trains in the Cordoba to Sevilla run so you may risk buying it on the day of (maybe when you arrive in Cordoba and have determined your energy and the weather. You can do some dummy buys to see if it really saves any money buying ahead. Or consider a changable ticket where you buy latest and change to earlier.
As well as the Mezquita, the Alcazar is okay....its garden much better. As it is designed less about flowers and more about evergreen plants and hardscapes, it can still be nice at that time of year. I enjoyed the Archeological Museum (i side so good for a rainy day). There is the Jewish Quarter, synagogue and points of interest, but it really doesn't take too long. If weather is good, the old Roman Bridge is a nice stroll to see the city from a different view.
If you ti ed it right and had an interest, there is the old city of al Zahra, but best done as a tour. Leaves Cordoba about 10:15 (I think) and returns after 2. You could get a taxi. There is no taxi waiting, but others say the staff will call one for you.
If you visit Mercado San Miguel while in Madrid and enjoyed it, consider Mercado Victoria in the park half way between the train station and old town. Quieter and more laid back. A great Venezuelan booth, but as cooked fresh, allow 10 minites or so for preparation . Not a buy and go booth.
There is/was a luggage storage business actoss from train station, but somewhere I heard he recently closed his business.