Please follow these steps:
From your Classroom page, click on the classroom for which you would like to update the code.
Click on the Students tab
Click on the 'Add Students' button (at the bottom of the page)
Click on the Select button under 'Share Class Code'
Click on the green arrows to regenerate a classcode:
Make sure to provide your students with the new classcode!