Convert following MySQL query to Codeigniter equivalent
<p>I'm very new to CodeIgniter and I have some problem converting MySQL queries to CodeIgniter. I want to update a record in one table with condition on another relational table.</p>

<p>Following is my MySQL query</p>

<pre><code>UPDATE `user` SET `securitytoken` = '71b9b5bc1094ee6eaeae8253e787d654'
WHERE `profileid` IN (SELECT pid FROM `profile` WHERE `email` = 'username@mail.com')    
</code></pre>

<p>This works fine in phpMyAdmin, but I wanted the same to be converted to codeigniter update query. Can anyone help me to convert.</p>

<p>I'm using CI v3.0.3 in Local WAMP Server.</p>

<p>Thanks in Advance</p>