Creating stored procedure in MySQL-8
Either use autocommit=1 throughout, or use BEGIN and COMMIT.

And, once set, you do not need to set autocommit again.

So, get rid of COMMIT and move the SET out of the loop.

Is some other process changing the value of is_summarized while this proc is sleeping?  I doubt if your technique will catch all edge cases correctly.

Instead of using a declared rows, use a variable:  @rows.  It does not need to be DECLAREd.

Most of the lines of the proc can be pulled out of the loop.  (However, this won't really make any difference.)

As for ROWS -- Most major versions and some minor versions introduce new keywords.  ROWS apparently was added between 5.6 and 8.0.  I avoid some such errors by prefixing any arguments to stored procs and declared variables in stored procs with an underscore.  This convention also helps avoid confusion between variables and column names.