In this paper, a mobility management technique for keying scheme of wireless sensor networks is presented. The technique selects nodes with high energy resources, wide communication range and high processing capacity as cluster heads. Cluster keys for cluster heads and pair wise keys for nodes are generated by the sink through Exclusion Basis Systems (EBS). Whenever a node moves from currently connected cluster to another in the network, the mobility based key management scheme is triggered. The sink verifies the authenticity of roaming node and allocates it to a nearby cluster.