your I-140 is definitely valid. But you have to be physically in the states when you submit 485 or you have to be in the USA when 485 is approved. I am not sure which one is right though.