Pass parameter to trigger dynamically
Since recalculating rankings for a large table can take a long time, and doing that frequently can mean a really long time, start with this question:


Will the recalculating during SELECT be "fast enough"?  If the answer to this question is 'yes', then simply do it.
Will the recalculation will be "fast enough" to do during INSERTs.  Also, ask whether the burden on the system is "too much".  If this is OK, then simply do it.
If both of those don't pass muster, periodically recompute the rankings.


Note that MySQL 8.0 and MariaDB 10.2 have ranking and other "windowing functions".  However, you need to test them -- they may not be "fast enough"; after all 'ranking' probably requires reading and sorting the entire table.