UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'INObYHyP1Yi9OSs5m63GP9aN9n9eUSCtMOpLhyu/IyI=' 
WHERE 
  key_id = 'a12def61b04a23b3a9d42e00ee33adf3c8427dc3529558e6a4038c6d7dbb210a' 
  AND (
    token = 'INObYHyP1Yi9OSs5m63GP9aN9n9eUSCtMOpLhyu/IyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031