UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDG2/op/BB3H1X7ZRc8AfrRREK4yADKfSVwiNwtKvDs=' 
WHERE 
  key_id = 'ce1ffd9c6e688576ea6e17362307ed62b33a1e10b64986880117514ff8be957b' 
  AND (
    token = 'vDG2/op/BB3H1X7ZRc8AfrRREK4yADKfSVwiNwtKvDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033