3 set elo=greatest(100, elo - ((current_date - (update_dt::date)-31)/7+1))
4 where update_dt < (current_timestamp at time zone 'UTC' - interval '30 days')
8 where player_id = pe.player_id
9 and update_dt >= (current_timestamp at time zone 'UTC' - interval '30 days')