You suspect an account is no longer used, but you’re not sure enough to delete it. Locking answers the question without losing anything.
One statement closes the account:
ALTER USER 'app'@'localhost' ACCOUNT LOCK;
New logins now fail with ERROR 4151: Access denied, this account is locked. The grants and password stay exactly as they were, and undoing it takes a second:
ALTER USER 'app'@'localhost' ACCOUNT UNLOCK;
To see the state of an account, SHOW CREATE USER 'app'@'localhost'; ends with ACCOUNT LOCK when it is locked.
My approach to an account nobody claims: lock it, wait a few weeks, and see who complains. Silence means it can go, with a note of its grants first. A complaint means a one line fix and a new entry in your documentation.
The lock stops new connections only. Sessions that are already open carry on, so for a leaked password, also find them with SHOW PROCESSLIST and end each with KILL and its ID. Applications with connection pools can hang on to a session for a long time, which can make a locked account seem perfectly healthy for hours.
Remember too that MariaDB treats 'app'@'localhost' and 'app'@'%' as separate accounts. Locking one leaves the other wide open, so check mysql.user for every host entry with that name.
Further reading: ALTER USER documentation, Account locking