How is a DateTime object formatted into a String suitable for a String based SOQL query?
DateTime dt = DateTime.now();
String formattedDt = dt.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'');
Update: Another option is to use SOQL dynamic binding, no formatting required.
DateTime dt = DateTime.now();
String query = 'SELECT Id FROM User WHERE SystemModstamp > :dt '
List<SObject> results = Database.query(query);