trigger to update row number
If you are running MySQL8.0, you could drop the column position, and create a view like this:

CREATE VIEW view_amariadbtable AS 
SELECT 
  id, 
  `key`, 
  year, 
  RANK() OVER (PARTITION BY year ORDER BY year DESC,id DESC) as position 
FROM amariadbtable


BTW, you should NOT use reserved words as column name (key)