What about the scenario where someone puts a gun to your head and forces you to vote for them - and you can't change your vote at a later period?
What about the scenario where someone puts a gun to your head and forces you to vote for them - and you can't change your vote at a later period?
One answer would be to just include the old ballot in the new one, so it's clear which one to invalidate if you see both.
I guess now that I'm thinking about it you also want to prevent ballots from being cast once the election is over, and timestamping an event as having happened before a given point is a valid use of an actual blockchain.
1. Votes can replace older votes - although this has issues because they could just make sure you don't vote again by pulling the trigger.
2. Let the voter assign 1 and 2 to A and B himself when receiving the private key - which means that when the time to click 1 or 2 comes - only the voter knows if 1 => A or 1 => B which makes it impossible to know who he is voting for.