Can I make this UPDATE faster?
You are running 17568 updates (and 17568 selects) for something that can be done with a single statement:

update d2
   set stav_1 = stav_2, 
       stav_2 = stav_3, 
       stav_3 = stav_4, 
       ....
where usek between 1 and 61;
commit;


If you don't want to type 288 column names, then use your program to generate the above statement and execute that once. 



Having numbered columns is very often a sign of a bad data model. The need to "move" values from one column to another is another sign that you should really re-design your data model and normalize it.