UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tMgRjjDaRNxV/+KXnzpwOoGGxi1EPH4dqFfFiSGFlLM=' 
WHERE 
  key_id = '213de1a72f50f655d485d11516c203dd2d5ae9e077a7afc2ce3ab3d881dbc571' 
  AND (
    token = 'tMgRjjDaRNxV/+KXnzpwOoGGxi1EPH4dqFfFiSGFlLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017