Long ago, when I truly sucked at CSing, I invented what I call "the minion game." It's simple. You just go into a custom game against 5 intermediate bots (so there will probably be 2 enemy champs bot lane, 1 mid). Go to lane and farm until you hit 50 CS, and look at the clock, see how long it took you. Once you hit 50 CS, exit the game and start again. You want to practice from the beginning, because last-hitting is most difficult at that stage.
Keep doing this over and over, from 0 to 50 CS, and see your improvement as it takes less time to get to 50. The nice thing about this is that you can do it whenever you want, and its less than a 10 minute time commitment each time you do it. It usually takes me about 6 minutes to get to 50 CS (I don't successfully kill every single minion).
If you want to make it really challenging, play a mage with low base AD, and don't buy a starting item. If you want to replicate game conditions, just play your normal champ with a normal starting item.
If you're disciplined about it, if you do this drill multiple times, you will 100% get better at timing your last hits. Having some enemy bots makes it a bit more challenging.
Facing real players in a real game will be more difficult, but at least you can learn the basics of timing, and the right moment for auto attacking each minion to ensure you deal the last hit.