Hello, thank you for your SQL
In my case, I had to even delete all rows in tbl. mdl_tool_customlang for non-existing
plugins in my current MDL version (3.9+).
It seems to be a bug, I will post it...
In my MySQL
, problems were with no longer used themes - Essential and Moove.