No, no expiry date. If you take good care of a lithium ion battery, it can provide a useful life of several decades. It is my understanding the main causes of cell aging are: calendar aging, amount of cycling, DoD (Depth of Discharge) during cycling, storage SoC (State of Charge), and temperature. Of course, the quality of manufacturing and the cell chemistry is also very important, but since we are focusing on e-Golf batteries, I am not aware of any known differences in cell quality, and I'm pretty sure the chemistry is same for all 2017+ cells, but VW does not disclose this information. Yes, a 2019 battery pack has a longer warranty and should give you more useful life. The main question about the 2017 is at what SoC was the battery stored? If it was stored at 100% for most of the time, that's not great. Also, if either pack "lived" in a very hot place, high temps will reduce useful life of the cells.
If you are able to drive both, you could try to estimate the usable pack capacity and use that info to help you decide.
2017 e-Golf LE, Multi Coat White with Black Vegan Leather interior