My pieces tend to be short, so your mileage may vary, but for what it's worth...
I try not to replace a joke for the sake of freshness alone - hopefully it made me laugh when I wrote it down. After that, my changes are intended to refine it and make it more specific or more precise or "funnier" after the piece as a whole has taken shape.
I will fix, replace or cut a joke if:
- It no longer fits the style of the piece, or the "voice" or character it's attributed to
- It's "dishonest" - the premise is inaccurate, spelling or grammar is forced, target is undeserving, anachronism sticks out, etc.
- It doesn't still make me chuckle internally to some degree
- It just doesn't work -- it hurts the pacing or is weaker than the rest of the piece; this happens sometimes with "bridge" gags used for structure early on, or early concepts that I thought HAD to be in there but have been overpowered by better stuff
I always try to imagine the reader/editor's reaction to insulate myself from the wear-out factor. Most importantly, I take some time away from it before finalizing - I can see what's funny and what's weighing it down more easily when my eyes are fresh.