Ideal solution: leave cached transcodes alone if the source file is the same and wasn't modified.
Easy solution: blow away the entire cache.
The problem we're trying to avoid here is, track with ID 4001 is deleted, a new completely unrelated track is assigned ID 4001, you play track 4001 (which let's say is a FLAC) expecting the new track, we serve you a cached transcode of the old track 4001.