You are correct, a hash is computed for the 'last modified time' of tables referenced by a cached query result. If the underlying data of a table that was referenced by the cached query has been modified, the 'last modified time' of the table will change which will effectively flush the now out-of-date cached query result.
If you are seeing stale data (aka queries that return from cache even though changes have been made to their referenced tables), I recommend filing an
issue report with the BigQuery team so that they may investigate the cause. Providing job IDs of queries that returned stale data will be helpful in their investigations.