In your settings.php file where you have prefix set in the $databases array. Change this
'prefix' => 'drupal_',
to this
'prefix' => array(
'default' => 'drupal_',
'my_table' => '',
),
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' => array (
'default' => array (
'database' => 'd7',
'username' => 'root',
'password' => '',
'host' => NULL,
'port' => '',
'driver' => 'mysql',
'prefix' => 'drupal_',
),
),
);
Change it to this, where everything is the same except the prefix is empty.
$databases = array (
'default' => array (
'default' => array (
'database' => 'd7',
'username' => 'root',
'password' => '',
'host' => NULL,
'port' => '',
'driver' => 'mysql',
'prefix' => 'drupal_',
),
'noprefix' => array (
'database' => 'd7',
'username' => 'root',
'password' => '',
'host' => NULL,
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
Then in your function call do this
$key_cached_update = db_update('my_table', array('target' => 'noprefix'))
->fields(array('key_cached' => $apikeyinfo->result->key['expires'],))
->condition('keyid', $row->keyid, '>=')
->execute();