What would happen if I just change by sql query maildir field value of a user?
It would break your system. Always use the remote API to do changes in the ispconfig db as all changes that you do directly in sql will not get processed by the server scripts.
But the function you posted above is wrong for that purpose as it will add a new user instaed of modifying a existing account. To modify existing accounts, use the update function.
For example in your case above, the direct change in the sql db will result in two mailboxes, a complete old one which is inaccessible and a partly created new one which misses functions like quota etc.