Below is the SOQL to query data which was modified between 4 PM and 6 PM.
Sample SOQL:
SELECT Id, LastModifiedDate FROM Account WHERE LastModifiedDate = TODAY AND HOUR_IN_DAY(LastModifiedDate) >= 16 AND HOUR_IN_DAY(LastModifiedDate) < 18
Cheers!!!