I would say both of them are correct. I have seen many publications where key changes are written by first naturalizing all accidentals that are not required and then adding whatever additional accidentals are required (as in the second one). A publication that uses this convention is the G. Schirmir Library of Classics.
Edit: I was browsing through some other posts, when I came across this post. Could be something you want to check out.
I summarize from Behind bars by Elaine Gould ("The Definitive Guide to Music Notation", as its cover claims):
Traditional practice cancels a key signature before a new one is created. There are slight variations, whether the cancelling happens before or after the bar line introducing the new signature as well as whether the natural signs precede or follow the new flat and sharps. Generally the new signature consists of as many "accidentals" (used here as generic term for sharps, flats, and naturals) as the old key-signature did, if the same type of accidental is used. If accidental type changes, all old ones have to be cancelled and the new ones written out.
Contemporary practice simply writes the new signature without any cancellation; the only exception is the change to a signature-less key as C major, where all active accidentals are cancelled