The query method returns false only when there is an error in executing. When no changes happens, there is no error, so query returns something other than false.
You can use
affected_rows property to check any rows are updated. It returns number of changed rows after the query.
More information: http://php.net/manual/en/mysqli.affected-rows.php