UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OmHPz7d+eNfX0atk1I1WWXvigDkXnAY4VBZzCOowVwk=' 
WHERE 
  key_id = '33c226955c591d9a68f59de2f1bab59cfed1a1b8d3e40bf1a7e41abb4dedeada' 
  AND (
    token = 'OmHPz7d+eNfX0atk1I1WWXvigDkXnAY4VBZzCOowVwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032