It's just an SQL query, so you'd run it on your database. You should know what it does though and how Chevereto handles expired images before you run it.
I think if you don't know how to run queries on the database then you probably shouldn't run queries on the database. It's possible to do a lot of damage. If you're interested in learning about basic MySQL that's great, it's just too much to get into here, and it's been covered elsewhere many times over.