UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qRrhfVa5r7T4Uf7Aw31YEvEDdfIxXmgOP+0Q5XJSxtY=' 
WHERE 
  key_id = '2f7ecbc101b775f199f61c33032e024aa623eec1bd2270c8b871d43c1bc57b05' 
  AND (
    token = 'qRrhfVa5r7T4Uf7Aw31YEvEDdfIxXmgOP+0Q5XJSxtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038