I'm on a Trek Rail 7, 3rd Gen with a Rockshox 160mm of fork travel and length of travel isn't all the story. My Scott mtb has 130mm of Fox fork suspension and is a much. much nicer ride than the Rail despite the increased travel. What I am saying is, don't get too caught up on the length of travel so much as the quality of the fork. I would trade 30mm of travel for a better quality fork any day of the week.
Also consider, a 2018 may have very worn components and if the previous owner rode the bike much, the fork could be about done by then. I have been getting about 5 years out of a fork before it needs to be rebuilt or replaced, and I am not a hard core rider. This is once or twice a week riding maybe 10 miles of moderate single track and no real jumps. If you get it cheap, then maybe worth it though.
At some point, buying an older emtb is not going to be worth the cost unless you can pick one up for a very good price and it is has not been used much. Considering the cost of the battery alone that could be reaching its life in that many years too. I am not trying to discourage you, just trying to prevent you from picking something up and then later realizing you have to drop $2k in it soon after.