There ARE expiration dates, but they're seldom printed on the devices. Occasionally you'll find a manufacture date on solid-state components.
The old standard in field engineering manuals used to be an expected service life of no more than ten years from original component manufacture until failure. Lots of exceptions, but this is EXPECTED service life.
Today's components generally have a shorter expected service life, because they're more heavily integrated.
The problem is that silicon in general (and the silicon compounds in specific that we use for solid-state electronics) is not a true crystalline substance - it's a PLASTIC substance. It flows or slumps, very slowly, over time. This can be witnessed easily by visiting any building with very old window glass - the glass is always thicker at the bottom than it is at the top.
In solid-state devices, the silicon can't slump very far before the component's ratings are compromised and the device fails. Much more so with greater integration, up to today's practical limits (which approach molecular transistor sizes). It takes VERY little slump in a five-micron transistor before the transistor fails under normal operating conditions.
And... it doesn't matter whether the device is under power or not - "slump never sleeps". Unpowered equipment lying on a shelf is just as likely to experience silicon-slump failure as well-designed equipment always powered up... which is why a "new old stock" replacement for an automotive computer is as likely to experience failure as the computer it's bought to replace.
ALL devices have SOME finite life, no question of that... especially if installed in poorly designed equipment and operated under conditions hostile to electronic devices. Passive devices (resistors, capacitors, inductors, etc), provided they're in well-designed equipment and operated well within their limitations, tend to last longer than active (silicon-based solid-state) devices, though, and gallium-based active devices tend to last better than silicon-based devices.
We'll all see some anecdotal responses here: "But I have a stereo that's thirty years old" and the like. Sure, there ARE exceptions. Sometimes we get lucky. How many of us are using computers older than about three years? Not many. How many 1990s vehicles do we see on the roads? We see them often in the junkyards, mechanically sound and sheet metal in good condition, but electronically not worth repairing. How old is your television? Your microwave oven? Your watch? Your camera? It all goes away, and every year the new equipment will go away earlier.