UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0FBaFZZ+aIGJ+puQXM+7sdaPdLSELWRHjiD4ciB2OP0=' 
WHERE 
  key_id = '85bb6754a8988fcbcfc1e9af659944c86c92c8d782218a155434ccc7e0e30ff4' 
  AND (
    token = '0FBaFZZ+aIGJ+puQXM+7sdaPdLSELWRHjiD4ciB2OP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044