db_update without table prefix on custom table
In your settings.php file where you have prefix set in the $databases array. Change this

'prefix' =&gt; 'drupal_',


to this

'prefix' =&gt; array(
  'default' =&gt; 'drupal_',
  'my_table' =&gt; '',
),


If you want a more wildcard like way to do this you can set the target. So lets say this is what your $databases array looks like inside settings.php

$databases = array (
  'default' =&gt; array (
    'default' =&gt; array (
      'database' =&gt; 'd7',
      'username' =&gt; 'root',
      'password' =&gt; '',
      'host' =&gt; NULL,
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; 'drupal_',
    ),
  ),
);


Change it to this, where everything is the same except the prefix is empty.

$databases = array (
  'default' =&gt; array (
    'default' =&gt; array (
      'database' =&gt; 'd7',
      'username' =&gt; 'root',
      'password' =&gt; '',
      'host' =&gt; NULL,
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; 'drupal_',
    ),
    'noprefix' =&gt; array (
      'database' =&gt; 'd7',
      'username' =&gt; 'root',
      'password' =&gt; '',
      'host' =&gt; NULL,
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
);


Then in your function call do this

$key_cached_update = db_update('my_table', array('target' =&gt; 'noprefix'))
  -&gt;fields(array('key_cached' =&gt; $apikeyinfo-&gt;result-&gt;key['expires'],))
  -&gt;condition('keyid', $row-&gt;keyid, '&gt;=')
  -&gt;execute();