MYSQL Update data based on top 10 records of each user
I may have a solution, but first please see if this computes the avg_scores correctly:

SELECT
        user_id, AVG(score) AS avg_score
    FROM
      ( SELECT  @prev := 0, @n := 0 ) init
    JOIN
      ( SELECT  @n := if(user_id != @prev, 1, @n + 1) AS n,
                @prev := user_id,
                user_id, score, id
            FROM  user_scores
            ORDER BY
                user_id  DESC,
                id  DESC
      ) x
    WHERE  n &lt;= 10
    GROUP BY user_id;


Recommend INDEX(user_id, id, score) on user_scores .

If that works, then a multi-table UPDATE may finish the task:

UPDATE   user
    JOIN ( the above ) AS y  USING(user_id)
    SET  user.user_score = y.avg_score;