What happens if file changes during backup?

There’s nothing any backup client can do if your storage is not idle. Beside detecting that file changed or grew during backup, in which case you will be informed, here’s an example:

warning for /opt/observium/rrd/stats02/perf-pollermodule-status.rrd: file has changed
warning for /var/log/account/pacct: expected 122095744 bytes, saved 122098112 bytes

If you need 100% consistent backup, you need to provide idle storage during the backup run, typically with some kind of snapshotting (LVM or whatever).

Also databases should have their own backup procedures, and are best avoided when doing filesystem backup. You can for example do a mysqldump or xtrabackup dump, then backup this file/dump, and exclude /var/lib/mysql completely.