I would also be cautious with the AK when somebody goes all in. If another ace comes up you think you have it made with AAK but I have been nailed more than once with somebody sitting on AA and then ending up with AAA. Boom !!!!
First of all, to stop replaying overpairs, you need to change your attitude towards them. You must finally understand what your pocket AA, QC, QQ, etc. - this is just one pair. That's all! No one promised you or guaranteed that with these
hands you will always win, even if your opponent pre-flop had a worse hand. Moreover, your overpairs about 25% of cases will not remain the best hands for showdown, which, you see, quite often.