diff --git a/oauth_common.module b/oauth_common.module
index c0a130f..fcf1748 100644
--- a/oauth_common.module
+++ b/oauth_common.module
@@ -167,16 +167,21 @@ function oauth_common_provider_token_load($tid) {
  * Implementation of hook_cron().
  */
 function oauth_common_cron() {
-  db_query("DELETE t, pt FROM {oauth_common_token} t LEFT JOIN {oauth_common_provider_token} pt ON pt.tid = t.tid
-    WHERE t.expires != 0 AND t.expires <= %d", array(
-      ':now' => time(),
-  ));
+  $now = time();
+
+  db_query("DELETE FROM {oauth_common_provider_token} WHERE tid IN
+    (SELECT tid FROM {oauth_common_token}
+    WHERE expires != 0 AND expires <= %d)", $now
+  );
+
+  db_query("DELETE FROM {oauth_common_token}
+    WHERE expires != 0 AND expires <= %d", $now
+  );
 
   // Should 300 be overriden in DrupalOAuthServer and made configurable?
   db_query("DELETE FROM {oauth_common_nonce}
-    WHERE `timestamp` < %d", array(
-      ':now' => time() - 300,
-  ));
+    WHERE timestamp < %d", $now - 300
+  );
 }
 
 /**
