Mass Air Flow sensor, cost? how long last?

I really have to wonder why you think it needs to be replaced. Do you have a check engine light and a code? Landfills are full of perfectly good parts that people replace either by guessing (using parts replacements as diagnostics) and/or assuming that computer codes that report problems in systems identify “bad parts.” E.g. there are OBDII codes that would lead you to check out a MAF system for a problem. But the problem could be in the wiring to & from the MAF rather than in the MAF itself. Electronics cleaner, dialectric grease, solder & heat shrink wraps…stuff like that are very cheap items. MAFs are very expensive.