There were two sets of tablets. The text of the first set is recorded in Exodus 20. The Second set is in Deuteronomy 5. The first set states:
זָכוֹר אֶת-יוֹם הַשַּׁבָּת, לְקַדְּשׁוֹ. Remember the sabbath day, to keep it holy.
The second set states:
Keep the Sabbath day to sanctify it, as the Lord your God commanded you. שָׁמ֛וֹר אֶת־י֥וֹם הַשַּׁבָּ֖ת לְקַדְּשׁ֑וֹ כַּֽאֲשֶׁ֥ר צִוְּךָ֖ יְהֹוָ֥ה אֱלֹהֶֽיךָ:
Rashi (Exodus 20:8) brings Chazal who posit -
זָכוֹר וְשָׁמוֹר בְּדִבּוּר אֶחָד נֶאֶמְרוּ Zachor and Shamor were uttered together.
The Mizrachi explains:
מזרחי (רא"ם) שמות פרק כ פסוק ח (פרשת יתרו) דאם לא כן יהיו הדברות הראשונות מתחלפות מהאחרונות, ואי אפשר זה, for if this was not the case (that they were uttered together), the sets of tablets would not be the same! This is impossible.
But, if they were said together, why were they not written together?