UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vlE1iFv1wuiiRETFbNjhjiap4Ume1vzBj8n0wt10ZjA=' 
WHERE 
  key_id = '6062502b5633d9c642d29e845fd45600089a0d4d71e9ae78870f6d03e56e4c3f' 
  AND (
    token = 'vlE1iFv1wuiiRETFbNjhjiap4Ume1vzBj8n0wt10ZjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016