If you create your array with the foreign ids as keys, rather than values, you only need to check isset(), which I believe will be the most efficient way of doing this. I.e.
$fids = array();
while ($row = $foreign_ids->fetch())
{
$fids[$row['fid']] = true;
}
while ($row = $access->fetch())
{
if (isset($fids[$row['id']]))
# update
else
#insert
}
But if you have a unique index on the foreign id field and use the same prepared statement, this is also efficient. You will however get queries that fail and then you have to check if the error is due to this reason and issue an update query instead.
Or if you use MySQL, you could use INSERT ... ON DUPLICATE KEY UPDATE ...
To be certain which is more efficient, you should profile both ways of doing it. If PHP server and DB server aren't the same, it's also a question about which machine you want to put the load on.