Move the key expiring to the checkpoint function.