Atmega88p with shift register 74hc595
That is doing it the hard way in my opinion.
Manipulate a byte (8 bits) or two with the LED on/off states.
Then just do a single SPI.transfer to send the data out.
All outputs will update at the same time. If you shift out the same data, the output stays the same.

// time for an output change?
digitalWrite (ssPin, LOW); // SS goes to RCLK
SPI.transfer(dataToDisplay);  // SCK goes to SH_CLK, Data goes to Serial Data In
SPI.transfer(dataToDisplay2);  // use if have 2  shift registers.
digitalWrite (ssPin, HIGH); // all outputs update on this rising edge