By comparing the tables of contents, the two books seem to contain almost the same material, with similar organization, with perhaps the omission of the chapter on excellent rings from the first, but the second book is considerably more user friendly for learners. There are about the same number of pages but almost twice as many words per page. The first book was almost like a set of class lecture notes from Professor Matsumura's 1967 course at Brandeis. Compared to the second book, the first had few exercises, relatively few references, and a short index. Chapters often began with definitions instead of a summary of results. Numerous definitions and basic ring theoretic concepts were taken for granted that are defined and discussed in the second. E.g. the fact that a power series ring over a noetherian ring is also noetherian is stated in the first book and proved in the second. The freeness of any projective modules over a local ring is stated in book one, proved in the finite case, and proved in general in book two. Derived functors such as Ext and Tor are assumed in the first book, while there is an appendix reviewing them in the second. Possibly the second book benefited from the input of the translator Miles Reid, at least Matsumura says so, and the difference in ease of reading between the two books is noticeable. Some arguments in the second are changed and adapted from the well written book by Atiyah and Macdonald. More than one of Matsumura's former students from his course at Brandeis which gave rise to the first book, including me, themselves prefer the second one. Thus, while experts may prefer book one, for many people who are reading Hartshorne, and are also learning commutative algebra, I would suggest the second book may be preferable.
Edit: Note there are also two editions of the earlier book Commutative algebra, and apparently only the second edition (according to its preface) includes the appendix with Matsumura's theory of excellent rings.