This is the case of proper adverb placement. Most adverbs can be classified into 10 different types. See the types here in Cambridge: Types of adverbs and their positions. Different types of adverbs go in different places [there are exceptions though].
"Carefully" is an adverb of the type manner (how something is done). Adverbs of manner can be placed in the mid-position or in the end position (depending on the intended effect).
According to Cambridge (from the linked source), adverbs of manner "usually go in end position." This is true if you want to focus or emphasize on how something is done or is being done (e.g., slowly, quickly, loudly, gently). "If the verb has an object, the adverb comes after the object".
She ate quickly. He ran to the store quickly. He looked at the numbers carefully.
"They sometimes go in mid position if the adverb is not the most important part of the clause or if the object is very long."
She quickly ate her dinner and ran out.
He carefully looked at the numbers and found huge discrepancies in the sales records.
The Chicago Manual of Style (16th Ed) says "to avoid miscues, an adverb should generally be placed as near as possible to the word it is intended to modify." - 5.167: Placement of adverbs
For example, what does "immediately" modify in the following sentence—compete or submitted?
"... the marathoners submitted their applications to compete immediately."
Here, "immediately" needs to be placed right before the verb it actually modifies—submitted.
If an adverb modifies a verb phrase, it should be placed between the auxiliary verb and the principal verb.
"... the administration has repudiated this view."
"... the administration has consistently repudiated this view."
I have thoroughly studied every single chapter for the test.
He has carefully looked at the numbers; he is now ready to fire the sales manager for stealing from the company.
Based on this, your example sentence should be
"I was carefully looking
carefully at it (=a mobile phone) to see who it belonged to."
"If an adverb qualifies an adjective, an adverb, a preposition, or a conjunction, it should immediately precede the word [that is] qualified".