I did a 400K by first doing a bunch of 200K rides, then two 300K rides about a month apart. I then did the 400K. I had no trouble finishing the ride.
The biggest thing is eating enough and not getting carried away and riding too hard.
BTW, they say that 400K is harder than 600K because most people do the 400K straight through but usually break a 600K into two 300K rides with a few hours of sleep in between.