The 770’s are much more comfy than the M40X’s, and have a wider soundstage.
Beyerdynamic has a great warranty, and every part on every 770 model is user-replaceable. You can order the parts straight from Beyerdynamic. So if durability is your thing, they’re a great option.
The M40X’s big advantage is that they have a “flatter” sound. The 770’s are a little bit aggressive in the bass and treble, which I love, but which might not be to your personal tastes.