This guy here selects the biggest number from the list (you can run this code from a mySQL UI immediate/query window or command line to test):
SET @foo = CONCAT('SELECT ', REPLACE('40,50,10,20', ',', ' UNION ALL SELECT '));
SET @foo = CONCAT('SELECT * FROM (', @foo, ' ORDER BY 1 DESC) AS uncleFoo LIMIT 1');
PREPARE STMT FROM @foo;
EXECUTE STMT;
DEALLOCATE PREPARE STMT;
So. The first "SET @foo" is sort of an explode function: It creates an SQL which selects numbers from the list into table rows. In the example above I entered "40,50,10,20" as you can see but you can use any number of items and any delimeter instead of ",".
Comment the 2nd "SET" line and execute query to see what exactly happens.
The next "SET @foo" extends the query so only the largest number will be given back (sort of a "SELECT max([field])" but we can't use 'max' here because of the nature of the query).
Then we execute the query so it returns only the largest number from the list.
If you want to update a field with the result, you should extended the query like:
UPDATE myTable SET myField=[value from above @foo execution] WHERE [your clause]
I think from this point you can easily figure out how to update the field you want in your specific case.
You can also move the above code into a function if it's not a "one time execution" to fix something but you'll need this update later too.
Hope this helps!